Hệ thống quản lý phòng khám trực tuyến bằng PHP

1 <?php
2     $currDir = dirname(__FILE__);
3     require(
"{$currDir}/incCommon.php");
4     require(
"{$currDir}/incHeader.php");
5 ?>
6
7     <style>
8         nav{ display: none; }
9     </style>
10
11 <?php
12
13     $recID = intval($_GET[
'recID']);
14     
if(!$recID){
15         
// no record provided
16         include(
"{$currDir}/incFooter.php");
17     }
18
19     
// fetch record data to fill in the form below
20     $res = sql(
"select * from membership_userrecords where recID='$recID'", $eo);
21     
if(!($row = db_fetch_assoc($res))){
22         echo Notification::show(array(
23             
'message' => $Translation["record not found error"],
24             
'class' => 'danger',
25             
'dismiss_seconds' => 3600
26         ));
27         include(
"{$currDir}/incFooter.php");
28     }
29
30     
// get record data
31     $tableName = $row[
'tableName'];
32     $pkValue = $row[
'pkValue'];
33     $memberID = strtolower($row[
'memberID']);
34     $dateAdded = @date($adminConfig[
'PHPDateTimeFormat'], $row['dateAdded']);
35     $dateUpdated = @date($adminConfig[
'PHPDateTimeFormat'], $row['dateUpdated']);
36     $groupID = $row[
'groupID'];
37
38     
// get pk field name
39     $pkField = getPKFieldName($tableName);
40
41     $res = sql(
"select * from `{$tableName}` where `{$pkField}`='" . makeSafe($pkValue, false) . "'", $eo);
42     
if(!($row = db_fetch_assoc($res))){
43         echo Notification::show(array(
44             
'message' => $Translation["record not found error"],
45             
'class' => 'danger',
46             
'dismiss_seconds' => 3600
47         ));
48         include(
"{$currDir}/incFooter.php");
49     }
50
51     ?>
52     <div
class="page-header"><h1>
53         <?php echo str_replace(
"<TABLENAME>", $tableName, $Translation["table name"]); ?>
54     </h1></div>
55
56     <table
class="table table-striped table-bordered table-hover">
57         <thead>
58             <tr>
59                 <th><?php echo $Translation[
"field name"]; ?></th>
60                 <th><?php echo $Translation[
"value"]; ?></th>
61             </tr>
62         </thead>
63
64         <tbody>
65         <?php
66             
foreach($row as $fn => $fv){
67                 $op = html_attr($fv);
68                 
if(@is_file("{$currDir}/../{$Translation['ImageFolder']}{$fv}")){
69                     $op =
"<a href=\"../{$Translation['ImageFolder']}{$fv}\" target=\"_blank\">" . html_attr($fv) . "</a>";
70                 }
71
72                 $tr_class = $pk_icon =
'';
73                 
if($fn == $pkField){
74                     $tr_class =
'class="text-primary"';
75                     $pk_icon =
'<i class="glyphicon glyphicon-star"></i> ';
76                 }
77                 ?>
78                 <tr <?php echo $tr_class; ?>>
79                     <th valign=
"top"><?php echo $pk_icon . $fn; ?></th>
80                     <td valign=
"top"><?php echo $op; ?></td>
81                 </tr>
82                 <?php
83             }
84         ?>
85         </tbody>
86     </table>
87
88     <script>
89         $j(function(){
90             $j(
'nav').next('div').remove();
91         })
92     </script>
93
94 <?php
95     include(
"{$currDir}/incFooter.php");
96 ?>


Gõ tìm kiếm nhanh...